// Selection datapump -- transforms a selection into an array_t
// Copyright 2006 (C) Ralph Thomas

#ifndef MISSION_DATAPUMPS_SELECTION_ARRAY_H
#define MISSION_DATAPUMPS_SELECTION_ARRAY_H

#include <binder.hpp>
#include <adobe/value.hpp>
#include <adobe/array.hpp>
#include <adobe/adam.hpp>

namespace datapumps {
	//
	/// The selection_array datapump takes a selection_ptr_t and
	/// returns an array of the selection.
	///
	/// \param	params	array containing the selection_ptr_t (or
	///					name/datapump that can be used to get it).
	/// \param	sheet	sheet to resolve @names into.
	///
	/// \return	a datapump that will return an util::concept::list compatible
	///			value.
	//
	adobe::value_t make_selection_array_datapump(const adobe::array_t& params, adobe::sheet_t& sheet);
	//
	/// The next datapump returns the next value from the
	/// selection.
	///
	/// \param	params	array containing the selection_ptr_t (or
	///					name/datapump that can be used to get it).
	/// \param	sheet	sheet to resolve @names into.
	///
	/// \return	a datapump that will return the next item.
	//
	adobe::value_t make_selection_next_datapump(const adobe::array_t& params, adobe::sheet_t& sheet);
	//
	/// The previous datapump returns the next value from the selection.
	///
	/// \param	params	array containing the selection_ptr_t (or
	///					name/datapump that can be used to get it).
	/// \param	sheet	sheet to resolve @names into.
	///
	/// \return	a datapump that will return the previous item.
	//
	adobe::value_t make_selection_prev_datapump(const adobe::array_t& params, adobe::sheet_t& sheet);
	//
	/// The "primary" selection (single item) of a selection.
	///
	/// \param	params	array containing the selection_ptr_t (or
	///					name/datapump that can be used to get it).
	/// \param	sheet	sheet to resolve @names into.
	///
	/// \return	a datapump that will return the primary item.
	//
	adobe::value_t make_selection_primary_datapump(const adobe::array_t& params, adobe::sheet_t& sheet);
};

#endif
